package com.example.demo.mapper.hr;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.controller.dto.UserAddressDto;
import com.example.demo.entity.hr.Resume;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface ResumeMapper extends BaseMapper<Resume> {
    // 一对多查询
    Page<Resume> findPage(Page<Resume> page, @Param("nickName") String nickName);

    @Select("select count(id) count, address from user GROUP BY address")
    List<UserAddressDto> countAddress();

    // 查询用户名
    @Select("select password from user where username=#{username}")
    Resume selectByName(String username);

    //修改密码
    @Update("update user set password = #{newPass} where id = #{userId}")
    int updatePass(Map<String, Object> map);




}
